package com.eshop.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import javax.validation.constraints.NotBlank;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

@TableName("job")
public class Job extends BaseDomain
{
    @TableId
    private Long id;
    @NotBlank(message = "岗位名称不能为空")
    private String name;
    private Boolean enabled;
    @TableField(exist = false)
    private Dept dept;
    private Long sort;
    private Long deptId;
    
    public void copy(final Job source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
    
    public Long getId() {
        return this.id;
    }
    
    public String getName() {
        return this.name;
    }
    
    public Boolean getEnabled() {
        return this.enabled;
    }
    
    public Dept getDept() {
        return this.dept;
    }
    
    public Long getSort() {
        return this.sort;
    }
    
    public Long getDeptId() {
        return this.deptId;
    }
    
    public void setId(final Long id) {
        this.id = id;
    }
    
    public void setName(final String name) {
        this.name = name;
    }
    
    public void setEnabled(final Boolean enabled) {
        this.enabled = enabled;
    }
    
    public void setDept(final Dept dept) {
        this.dept = dept;
    }
    
    public void setSort(final Long sort) {
        this.sort = sort;
    }
    
    public void setDeptId(final Long deptId) {
        this.deptId = deptId;
    }
    
    public String toString() {
        return "Job(id=" + this.getId() + ", name=" + this.getName() + ", enabled=" + this.getEnabled() + ", dept=" + this.getDept() + ", sort=" + this.getSort() + ", deptId=" + this.getDeptId() + ")";
    }
    
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof Job)) {
            return false;
        }
        final Job other = (Job)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        Label_0075: {
            if (this$id == null) {
                if (other$id == null) {
                    break Label_0075;
                }
            }
            else if (this$id.equals(other$id)) {
                break Label_0075;
            }
            return false;
        }
        final Object this$enabled = this.getEnabled();
        final Object other$enabled = other.getEnabled();
        Label_0112: {
            if (this$enabled == null) {
                if (other$enabled == null) {
                    break Label_0112;
                }
            }
            else if (this$enabled.equals(other$enabled)) {
                break Label_0112;
            }
            return false;
        }
        final Object this$sort = this.getSort();
        final Object other$sort = other.getSort();
        Label_0149: {
            if (this$sort == null) {
                if (other$sort == null) {
                    break Label_0149;
                }
            }
            else if (this$sort.equals(other$sort)) {
                break Label_0149;
            }
            return false;
        }
        final Object this$deptId = this.getDeptId();
        final Object other$deptId = other.getDeptId();
        Label_0186: {
            if (this$deptId == null) {
                if (other$deptId == null) {
                    break Label_0186;
                }
            }
            else if (this$deptId.equals(other$deptId)) {
                break Label_0186;
            }
            return false;
        }
        final Object this$name = this.getName();
        final Object other$name = other.getName();
        Label_0223: {
            if (this$name == null) {
                if (other$name == null) {
                    break Label_0223;
                }
            }
            else if (this$name.equals(other$name)) {
                break Label_0223;
            }
            return false;
        }
        final Object this$dept = this.getDept();
        final Object other$dept = other.getDept();
        if (this$dept == null) {
            if (other$dept == null) {
                return true;
            }
        }
        else if (this$dept.equals(other$dept)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof Job;
    }
    
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final Object $id = this.getId();
        result = result * 59 + (($id == null) ? 43 : $id.hashCode());
        final Object $enabled = this.getEnabled();
        result = result * 59 + (($enabled == null) ? 43 : $enabled.hashCode());
        final Object $sort = this.getSort();
        result = result * 59 + (($sort == null) ? 43 : $sort.hashCode());
        final Object $deptId = this.getDeptId();
        result = result * 59 + (($deptId == null) ? 43 : $deptId.hashCode());
        final Object $name = this.getName();
        result = result * 59 + (($name == null) ? 43 : $name.hashCode());
        final Object $dept = this.getDept();
        result = result * 59 + (($dept == null) ? 43 : $dept.hashCode());
        return result;
    }
}
